home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
minix
/
up1510b.tgz
/
up1510b
/
src
/
mm
/
break.c.D
< prev
next >
Wrap
Text File
|
1990-07-25
|
4KB
|
123 lines
*** /tmp/,RCSt1022396 Wed Jul 25 13:59:39 1990
--- break.c Mon Jul 23 16:16:33 1990
***************
*** 18,25 ****
! #include "../h/const.h"
! #include "../h/type.h"
! #include "../h/error.h"
! #include "../h/signal.h"
! #include "const.h"
! #include "glo.h"
#include "mproc.h"
--- 18,21 ----
! #include "mm.h"
! #include <signal.h>
#include "mproc.h"
***************
*** 39,44 ****
* the stack pointer can grow beyond the base of the stack segment without
! * anybody noticing it. For a file not using separate I & D space,
! * the parameter, 'addr' is the total size, text + data. For a file using
! * separate text and data spaces, it is just the data size. Files using
! * separate I & D space have the SEPARATE bit in mp_flags set.
*/
--- 35,38 ----
* the stack pointer can grow beyond the base of the stack segment without
! * anybody noticing it.
! * The parameter, 'addr' is the new virtual address in D space.
*/
***************
*** 51,60 ****
rmp = mp;
! v = (vir_bytes) addr; /* 'addr' is the new data segment size */
new_clicks = (vir_clicks) ( ((long) v + CLICK_SIZE - 1) >> CLICK_SHIFT);
- #ifdef ATARI_ST
- /*
- * Probably not ATARI_ST specific. 'addr' is a virtual address,
- * not an offset in D space.
- * Cleanup some comments above as well.
- */
if (new_clicks < rmp->mp_seg[D].mem_vir) {
--- 45,48 ----
rmp = mp;
! v = (vir_bytes) addr;
new_clicks = (vir_clicks) ( ((long) v + CLICK_SIZE - 1) >> CLICK_SHIFT);
if (new_clicks < rmp->mp_seg[D].mem_vir) {
***************
*** 64,66 ****
new_clicks -= rmp->mp_seg[D].mem_vir;
- #endif
sys_getsp(who, &new_sp); /* ask kernel for current sp value */
--- 52,53 ----
***************
*** 68,70 ****
res_ptr = (r == OK ? addr : (char *) -1);
! return(r); /* return new size or -1 */
}
--- 55,57 ----
res_ptr = (r == OK ? addr : (char *) -1);
! return(r); /* return new address or -1 */
}
***************
*** 95,96 ****
--- 82,85 ----
+ if(rmp - mproc == INIT_PROC_NR) return(OK); /* don't bother init */
+
/* See if stack size has gone negative (i.e., sp too close to 0xFFFF...) */
***************
*** 103,105 ****
lower = (delta > 0 ? sp_click : mem_sp->mem_vir);
! gap_base = mem_dp->mem_vir + data_clicks;
if (lower < gap_base) return(ENOMEM); /* data and stack collided */
--- 92,98 ----
lower = (delta > 0 ? sp_click : mem_sp->mem_vir);
!
! /* Add a safety margin for future stack growth. Impossible to do right. */
! #define SAFETY_BYTES (384 * sizeof(char *))
! #define SAFETY_CLICKS ((SAFETY_BYTES + CLICK_SIZE - 1) / CLICK_SIZE)
! gap_base = mem_dp->mem_vir + data_clicks + SAFETY_CLICKS;
if (lower < gap_base) return(ENOMEM); /* data and stack collided */
***************
*** 159,161 ****
! #ifndef ATARI_ST
int pt, pd, ps; /* segment sizes in pages */
--- 152,154 ----
! #if (PAGE_SIZE > 1)
int pt, pd, ps; /* segment sizes in pages */
***************
*** 162,166 ****
! pt = (int) ( ((long)tc << CLICK_SHIFT) + PAGE_SIZE - 1)/PAGE_SIZE;
! pd = (int) ( ((long)dc << CLICK_SHIFT) + PAGE_SIZE - 1)/PAGE_SIZE;
! ps = (int) ( ((long)sc << CLICK_SHIFT) + PAGE_SIZE - 1)/PAGE_SIZE;
--- 155,159 ----
! pt = ( (tc << CLICK_SHIFT) + PAGE_SIZE - 1)/PAGE_SIZE;
! pd = ( (dc << CLICK_SHIFT) + PAGE_SIZE - 1)/PAGE_SIZE;
! ps = ( (sc << CLICK_SHIFT) + PAGE_SIZE - 1)/PAGE_SIZE;
***************
*** 182,184 ****
*===========================================================================*/
! PUBLIC stack_fault(proc_nr)
int proc_nr; /* tells who got the stack fault */
--- 175,177 ----
*===========================================================================*/
! PUBLIC void stack_fault(proc_nr)
int proc_nr; /* tells who got the stack fault */
***************
*** 195,197 ****
sys_getsp((int)(rmp - mproc), &new_sp);
! #ifdef ATARI_ST
new_sp -= CLICK_SIZE; /* one click margin between D and S */
--- 188,190 ----
sys_getsp((int)(rmp - mproc), &new_sp);
! #if (CHIP == M68000)
new_sp -= CLICK_SIZE; /* one click margin between D and S */